typedef struct ByteBit
{
   unsigned BIT0:1;
   unsigned BIT1:1;
   unsigned BIT2:1;
   unsigned BIT3:1;
   unsigned BIT4:1;
   unsigned BIT5:1;
   unsigned BIT6:1;
   unsigned BIT7:1;
}BYTE_BIT;
//macro
#define SET_BIT8_FORMAT(Var) (*((volatile BYTE_BIT*)&(Var)))
//PORTx
#ifdef PORTA
   #define PORTA_BIT SET_BIT8_FORMAT(PORTA)
#endif
#ifdef PORTB
  #define PORTB_BIT SET_BIT8_FORMAT(PORTB)
#endif
#ifdef PORTC
  #define PORTC_BIT SET_BIT8_FORMAT(PORTC)
#endif
#ifdef PORTD
  #define PORTD_BIT SET_BIT8_FORMAT(PORTD)
#endif
//PINx
#ifdef PINA
   #define PINA_BIT SET_BIT8_FORMAT(PINA)
#endif
#ifdef PINB
   #define PINB_BIT SET_BIT8_FORMAT(PINB)
#endif
#ifdef PINC
   #define PINC_BIT SET_BIT8_FORMAT(PINC)
#endif
#ifdef PIND
   #define PIND_BIT SET_BIT8_FORMAT(PIND)
#endif
//DDRx
#ifdef DDRA
   #define DDRA_BIT SETB_BIT8_FORMAT(DDRA)
#endif
#ifdef DDRB
   #define DDRB_BIT SETB_BIT8_FORMAT(DDRB)
#endif
#ifdef DDRC
   #define DDRC_BIT SETB_BIT8_FORMAT(DDRC)
#endif
#ifdef DDRD
   #define DDRD_BIT SETB_BIT8_FORMAT(DDRD)
#endif
//PORT_Pxn
#ifdef PORTA
   #define PORT_PA0 PORTA_BIT.BIT0
   #define PORT_PA1 PORTA_BIT.BIT1
   #define PORT_PA2 PORTA_BIT.BIT2
   #define PORT_PA3 PORTA_BIT.BIT3
   #define PORT_PA4 PORTA_BIT.BIT4
   #define PORT_PA5 PORTA_BIT.BIT5
   #define PORT_PA6 PORTA_BIT.BIT6
   #define PORT_PA7 PORTA_BIT.BIT7
#endif
#ifdef PORTB
   #define PORT_PB0 PORTB_BIT.BIT0
   #define PORT_PB1 PORTB_BIT.BIT1
   #define PORT_PB2 PORTB_BIT.BIT2
   #define PORT_PB3 PORTB_BIT.BIT3
   #define PORT_PB4 PORTB_BIT.BIT4
   #define PORT_PB5 PORTB_BIT.BIT5
   #define PORT_PB6 PORTB_BIT.BIT6
   #define PORT_PB7 PORTB_BIT.BIT7
#endif
#ifdef PORTC
   #define PORT_PC0 PORTC_BIT.BIT0
   #define PORT_PC1 PORTC_BIT.BIT1
   #define PORT_PC2 PORTC_BIT.BIT2
   #define PORT_PC3 PORTC_BIT.BIT3
   #define PORT_PC4 PORTC_BIT.BIT4
   #define PORT_PC5 PORTC_BIT.BIT5
   #define PORT_PC6 PORTC_BIT.BIT6
   #define PORT_PC7 PORTC_BIT.BIT7
#endif
#ifdef PORTD
   #define PORT_PD0 PORTD_BIT.BIT0
   #define PORT_PD1 PORTD_BIT.BIT1
   #define PORT_PD2 PORTD_BIT.BIT2
   #define PORT_PD3 PORTD_BIT.BIT3
   #define PORT_PD4 PORTD_BIT.BIT4
   #define PORT_PD5 PORTD_BIT.BIT5
   #define PORT_PD6 PORTD_BIT.BIT6
   #define PORT_PD7 PORTD_BIT.BIT7
#endif
//DDR_Pxn
#ifdef DDRA
   #define DDR_PA0 DDRA_BIT.BIT0
   #define DDR_PA1 DDRA_BIT.BIT1
   #define DDR_PA2 DDRA_BIT.BIT2
   #define DDR_PA3 DDRA_BIT.BIT3
   #define DDR_PA4 DDRA_BIT.BIT4
   #define DDR_PA5 DDRA_BIT.BIT5
   #define DDR_PA6 DDRA_BIT.BIT6
   #define DDR_PA7 DDRA_BIT.BIT7
#endif
#ifdef DDRB
   #define DDR_PB0 DDRB_BIT.BIT0
   #define DDR_PB1 DDRB_BIT.BIT1
   #define DDR_PB2 DDRB_BIT.BIT2
   #define DDR_PB3 DDRB_BIT.BIT3
   #define DDR_PB4 DDRB_BIT.BIT4
   #define DDR_PB5 DDRB_BIT.BIT5
   #define DDR_PB6 DDRB_BIT.BIT6
   #define DDR_PB7 DDRB_BIT.BIT7
#endif
#ifdef DDRC
   #define DDR_PC0 DDRC_BIT.BIT0
   #define DDR_PC1 DDRC_BIT.BIT1
   #define DDR_PC2 DDRC_BIT.BIT2
   #define DDR_PC3 DDRC_BIT.BIT3
   #define DDR_PC4 DDRC_BIT.BIT4
   #define DDR_PC5 DDRC_BIT.BIT5
   #define DDR_PC6 DDRC_BIT.BIT6
   #define DDR_PC7 DDRC_BIT.BIT7
#endif
#ifdef DDRD
   #define DDR_PD0 DDRD_BIT.BIT0
   #define DDR_PD1 DDRD_BIT.BIT1
   #define DDR_PD2 DDRD_BIT.BIT2
   #define DDR_PD3 DDRD_BIT.BIT3
   #define DDR_PD4 DDRD_BIT.BIT4
   #define DDR_PD5 DDRD_BIT.BIT5
   #define DDR_PD6 DDRD_BIT.BIT6
   #define DDR_PD7 DDRD_BIT.BIT7
#endif
//PIN_Pxn
#ifdef PINA
   #define PIN_PA0 PINA_BIT.BIT0
   #define PIN_PA1 PINA_BIT.BIT1
   #define PIN_PA2 PINA_BIT.BIT2
   #define PIN_PA3 PINA_BIT.BIT3
   #define PIN_PA4 PINA_BIT.BIT4
   #define PIN_PA5 PINA_BIT.BIT5
   #define PIN_PA6 PINA_BIT.BIT6
   #define PIN_PA7 PINA_BIT.BIT7
#endif
#ifdef PINB
   #define PIN_PB0 PINB_BIT.BIT0
   #define PIN_PB1 PINB_BIT.BIT1
   #define PIN_PB2 PINB_BIT.BIT2
   #define PIN_PB3 PINB_BIT.BIT3
   #define PIN_PB4 PINB_BIT.BIT4
   #define PIN_PB5 PINB_BIT.BIT5
   #define PIN_PB6 PINB_BIT.BIT6
   #define PIN_PB7 PINB_BIT.BIT7
#endif
#ifdef PINC
   #define PIN_PC0 PINC_BIT.BIT0
   #define PIN_PC1 PINC_BIT.BIT1
   #define PIN_PC2 PINC_BIT.BIT2
   #define PIN_PC3 PINC_BIT.BIT3
   #define PIN_PC4 PINC_BIT.BIT4
   #define PIN_PC5 PINC_BIT.BIT5
   #define PIN_PC6 PINC_BIT.BIT6
   #define PIN_PC7 PINC_BIT.BIT7
#endif
#ifdef PIND
   #define PIN_PD0 PIND_BIT.BIT0
   #define PIN_PD1 PIND_BIT.BIT1
   #define PIN_PD2 PIND_BIT.BIT2
   #define PIN_PD3 PIND_BIT.BIT3
   #define PIN_PD4 PIND_BIT.BIT4
   #define PIN_PD5 PIND_BIT.BIT5
   #define PIN_PD6 PIND_BIT.BIT6
   #define PIN_PD7 PIND_BIT.BIT7
#endif